(function() {
	define('dynamicTable', function(){
		
		function _deleteTrNextTrList(id) {
			var tempTrLlist = $('#' + id).nextAll();
			var i = 0, len = tempTrLlist.length;
			for(i=0; i<len; i++) {
				$(tempTrLlist[i]).remove();
			}
		}
		//针对目标生成表格
		function _handleIndexData(indexData) {
			var i = 0, len =indexData? indexData.length : 0, tempObj = null,
				firstIndex = "", secondIndex="", thirdIndex="",
				indexValue = "", targetType = "",
				firstConstant = "firstIndex", secondConstant = "secondIndex",
				filledConstant = "filled", notfilledConstant = "notFilled",
				trList = [], trListLen = 0, tr = {}, firstTd = {}, tdRowspan = 0,
				tdListFilled = [], tdListFilledLen = tdListFilled.length, indexObj = {},
				tdListNotFilled = [], tdListNotFilledLen = tdListNotFilled.length, notFilledObj = {},
				filledParent = {}, notFilledParent = {}, j = 0,
				rowspanTdsList = [], rowspanTdsListLen = 0, tdTempRowSpan = "";
			
			var trId = "", trClass = "", tdClass="";
			for(i = 0; i<len; i++) {
				tempObj = indexData[i];
				firstIndex = tempObj['firstIndex'];
				secondIndex = tempObj['secondIndex'];
				thirdIndex = tempObj['thirdIndex'];
				indexValue = tempObj['indexValue']?tempObj['indexValue']: "";
				targetType = tempObj['targetType'];
				
				trId = firstConstant + firstIndex;
				trClass = secondConstant + "_" + firstIndex + '_' + secondIndex;
				tdClass = secondConstant + "_" + targetType + "_" + firstIndex + '_' + secondIndex;
				
				tr = $('#' + trId);
				
				trList = $('tr[class=' + trClass + ']');
				trListLen = trList.length;
				
				tdListFilled = $('.' + tdClass + '.' + filledConstant);
				tdListFilledLen = tdListFilled.length;
				
				tdListNotFilled = $('.' + tdClass + '.' + notfilledConstant);
				tdListNotFilledLen = tdListNotFilled.length;
				
				if(tdListNotFilledLen == 0) {
					//添加一个新的tr
					filledParent = $(tdListFilled[tdListFilledLen-1]).parent();
					indexObj = getIndexObj(trId, firstIndex, secondIndex, thirdIndex, indexValue, targetType, tdListFilledLen+1);
					$(filledParent).after(indexObj);
					
					//修改tr中第一个td的rowspan
					firstTd = tr.children()[0];
					tdRowspan = $(firstTd).attr('rowspan');
					$(firstTd).attr('rowspan', parseInt(tdRowspan)+1);
					
					//修改td上的rowspan
					changeTdRowSpan(trList, trClass);
				} else {
					//找到td直接复制
					putValueToTd(tdListNotFilled, tdClass, thirdIndex, indexValue, tdListFilledLen+1);
				} 
			}
			
			//修改tr中第一个td的rowspan
			function changeTdRowSpan(trList, trClass){
				var rowspanTdsList = $(trList[0]).find('td[class=' + trClass + ']'),
					i = 0, len = rowspanTdsList.length, tdTempRowSpan = 0;
				for(i=0; i<len; i++) {
					tdTempRowSpan = $(rowspanTdsList[i]).attr("rowspan");
					$(rowspanTdsList[i]).attr("rowspan", parseInt(tdTempRowSpan)+1);
				}
			}
			
			//找到notFIlled，然后添加值
			function putValueToTd(tdListNotFilled, tdClass, thirdIndex, indexValue, tdListFilledLen) {
				var notFilledTdObj = $(tdListNotFilled[0]);
				notFilledTdObj.html('指标' + tdListFilledLen + ':' + thirdIndex);
				notFilledTdObj.next().html(indexValue);
				notFilledTdObj.removeClass("notFilled").addClass("filled");
			}
			
			
			function getIndexObj(trId, firstIndex, secondIndex, thirdIndex, indexValue, targetType, no) {
				if(targetType == 0) {
					return ['<tr id="' + trId + '" class="secondIndex_' + firstIndex + '_' + secondIndex + '">',
					        '<td class="'+ 'secondIndex_0_' + firstIndex + '_' + secondIndex + ' filled">' + "指标" + no +':' + thirdIndex + '</td>',
					      	'<td>' + indexValue + '</td>',
					      	'<td class="secondIndex_1_' + firstIndex + '_' + secondIndex + ' notFilled"></td>',
					      	'<td></td>',
					      	'</tr>'].join("");
				} else if(targetType == 1) {
					return ['<tr id="' + trId + '" class="secondIndex_' + firstIndex + '_' + secondIndex + '">',
					        '<td class="'+ 'secondIndex_0_' + firstIndex + '_' + secondIndex + ' notFilled"></td>',
					      	'<td></td>',
					      	'<td class="secondIndex_1_' + firstIndex + '_' + secondIndex + ' filled">' + "指标" + no +':' + thirdIndex + '</td>',
					      	'<td>' + indexValue + '</td>',
					      	'</tr>'].join("");
				} else {
					return;
				}
			}
		}
		
		function _getOnlyTable() {
			return ['<table id="innerTable" width="100%" border="1" align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				      '<tr>',
				        '<td width="3%">一级指标</td>',
				        '<td width="8%">二级指标</td>',
				        '<td width="23%">三级指标</td>',
				        '<td width="13.99%">指标值</td>',
				        '<td width="9%">二级指标</td>',
				        '<td width="23%">三级指标</td>',
				        '<td width="20%">指标值</td>',
				      '</tr>',
				      '<tr id="firstIndex0" class="secondIndex_0_0">',
				        '<td rowspan="4">',
				         	 '产<br/>出<br/>指<br/>标</td>',
				        '<td rowspan="1" class="secondIndex_0_0">数量指标</td>',
				        '<td class="secondIndex_0_0_0 notFilled"></td>',
				        '<td ></td>',
				        '<td rowspan="1" class="secondIndex_0_0">数量指标</td>',
				        '<td class="secondIndex_1_0_0 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				      '<tr class="secondIndex_0_1">',
				        '<td rowspan="1" class="secondIndex_0_1">质量指标</td>',
				        '<td class="secondIndex_0_0_1 notFilled"></td>',
				        '<td></td>',
				        '<td rowspan="1" class="secondIndex_0_1">质量指标</td>',
				        '<td class="secondIndex_1_0_1 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				      '<tr class="secondIndex_0_2">',
				        '<td rowspan="1" class="secondIndex_0_2">时效指标</td>',
				        '<td class="secondIndex_0_0_2 notFilled"></td>',
				        '<td></td>',
				        '<td rowspan="1" class="secondIndex_0_2">时效指标</td>',
				        '<td class="secondIndex_1_0_2 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				      '<tr class="secondIndex_0_3">',
				        '<td rowspan="1" class="secondIndex_0_3">成本指标</td>',
				        '<td class="secondIndex_0_0_3 notFilled"></td>',
				        '<td ></td>',
				        '<td rowspan="1" class="secondIndex_0_3">成本指标</td>',
				        '<td class="secondIndex_1_0_3 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				      '<tr id="firstIndex1" class="secondIndex_1_0">',
				        '<td rowspan="4">效<br/>益<br/>指<br/>标</td>',
				        '<td rowspan="1" class="secondIndex_1_0">经济效益<br/>指标</td>',
				        '<td class="secondIndex_0_1_0 notFilled"></td>',
				        '<td ></td>',
				        '<td rowspan="1" class="secondIndex_1_0">经济效益<br/>指标</td>',
				        '<td class="secondIndex_1_1_0 notFilled"></td>',
				        '<td>&nbsp;</td>',
				      '</tr>',
				      '<tr class="secondIndex_1_1">',
				        '<td rowspan="1" class="secondIndex_1_1">社会效益<br/>指标</td>',
				        '<td class="secondIndex_0_1_1 notFilled"></td>',
				        '<td ></td>',
				        '<td rowspan="1" class="secondIndex_1_1">社会效益<br/>指标</td>',
				        '<td class="secondIndex_1_1_1 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				      '<tr class="secondIndex_1_2">',
				        '<td rowspan="1" class="secondIndex_1_2">生态效益<br/> 指标</td>',
				        '<td class="secondIndex_0_1_2 notFilled"></td>',
				        '<td></td>',
				        '<td rowspan="1" class="secondIndex_1_2">生态效益<br/>指标</td>',
				        '<td class="secondIndex_1_1_2 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				      '<tr class="secondIndex_1_3">',
				        '<td rowspan="1" class="secondIndex_1_3">可持续影响<br/>指标</td>',
				        '<td class="secondIndex_0_1_3 notFilled"></td>',
				        '<td></td>',
				        '<td rowspan="1" class="secondIndex_1_3">可持续影响<br/>指标</td>',
				        '<td class="secondIndex_1_1_3 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				      '<tr id="firstIndex2" class="secondIndex_2_0">',
				        '<td rowspan="1">满意度指标</td>',
				        '<td rowspan="1" class="secondIndex_2_0">服务对象<br/>满意度指标</td>',
				        '<td class="secondIndex_0_2_0 notFilled"></td>',
				        '<td></td>',
				        '<td rowspan="1" class="secondIndex_2_0">服务对象<br/>满意度指标</td>',
				        '<td class="secondIndex_1_2_0 notFilled"></td>',
				        '<td></td>',
				      '</tr>',
				    '</table>'].join("");
		}
		
		function _getInitTableContent() {
			
		 return ['<tr>',
		    '<td rowspan="2">总体目标</td>',
		    '<td colspan="2">实施期目标</td>',
		    '<td colspan="2">年度目标</td>',
		  '</tr>',
		  '<tr>',
		  	'<td height="26" colspan="2" data-name="targetNameOfImplphase" style="text-align:left;text-indent:2em;">',
				'<ul class="target-list" id="target_list"></ul>',	  	
		  	'</td>',
		  	'<td colspan="2" data-name="annualTargetDatalist">',
		  		'<div class="aunnal-target-list" id="aunnal_target_list">',
		  		'</div>',
		  	'</td>',
		  '</tr>',
		  '<tr>',
		    '<td>绩效指标</td>',
		    '<td height="141" colspan="4" style="padding:0px;">',
		    '<table id="innerTable" width="100%" border="1" align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
		      '<tr>',
		        '<td width="3%">一级指标</td>',
		        '<td width="8%">二级指标</td>',
		        '<td width="23%">三级指标</td>',
		        '<td width="13.99%">指标值</td>',
		        '<td width="9%">二级指标</td>',
		        '<td width="23%">三级指标</td>',
		        '<td width="20%">指标值</td>',
		      '</tr>',
		      '<tr id="firstIndex0" class="secondIndex_0_0">',
		        '<td rowspan="4">',
		         	 '产<br/>出<br/>指<br/>标</td>',
		        '<td rowspan="1" class="secondIndex_0_0">数量指标</td>',
		        '<td class="secondIndex_0_0_0 notFilled"></td>',
		        '<td ></td>',
		        '<td rowspan="1" class="secondIndex_0_0">数量指标</td>',
		        '<td class="secondIndex_1_0_0 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		      '<tr class="secondIndex_0_1">',
		        '<td rowspan="1" class="secondIndex_0_1">质量指标</td>',
		        '<td class="secondIndex_0_0_1 notFilled"></td>',
		        '<td></td>',
		        '<td rowspan="1" class="secondIndex_0_1">质量指标</td>',
		        '<td class="secondIndex_1_0_1 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		      '<tr class="secondIndex_0_2">',
		        '<td rowspan="1" class="secondIndex_0_2">时效指标</td>',
		        '<td class="secondIndex_0_0_2 notFilled"></td>',
		        '<td></td>',
		        '<td rowspan="1" class="secondIndex_0_2">时效指标</td>',
		        '<td class="secondIndex_1_0_2 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		      '<tr class="secondIndex_0_3">',
		        '<td rowspan="1" class="secondIndex_0_3">成本指标</td>',
		        '<td class="secondIndex_0_0_3 notFilled"></td>',
		        '<td ></td>',
		        '<td rowspan="1" class="secondIndex_0_3">成本指标</td>',
		        '<td class="secondIndex_1_0_3 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		      '<tr id="firstIndex1" class="secondIndex_1_0">',
		        '<td rowspan="4">效<br/>益<br/>指<br/>标</td>',
		        '<td rowspan="1" class="secondIndex_1_0">经济效益<br/>指标</td>',
		        '<td class="secondIndex_0_1_0 notFilled"></td>',
		        '<td ></td>',
		        '<td rowspan="1" class="secondIndex_1_0">经济效益<br/>指标</td>',
		        '<td class="secondIndex_1_1_0 notFilled"></td>',
		        '<td>&nbsp;</td>',
		      '</tr>',
		      '<tr class="secondIndex_1_1">',
		        '<td rowspan="1" class="secondIndex_1_1">社会效益<br/>指标</td>',
		        '<td class="secondIndex_0_1_1 notFilled"></td>',
		        '<td ></td>',
		        '<td rowspan="1" class="secondIndex_1_1">社会效益<br/>指标</td>',
		        '<td class="secondIndex_1_1_1 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		      '<tr class="secondIndex_1_2">',
		        '<td rowspan="1" class="secondIndex_1_2">生态效益<br/> 指标</td>',
		        '<td class="secondIndex_0_1_2 notFilled"></td>',
		        '<td></td>',
		        '<td rowspan="1" class="secondIndex_1_2">生态效益<br/>指标</td>',
		        '<td class="secondIndex_1_1_2 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		      '<tr class="secondIndex_1_3">',
		        '<td rowspan="1" class="secondIndex_1_3">可持续影响<br/>指标</td>',
		        '<td class="secondIndex_0_1_3 notFilled"></td>',
		        '<td></td>',
		        '<td rowspan="1" class="secondIndex_1_3">可持续影响<br/>指标</td>',
		        '<td class="secondIndex_1_1_3 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		      '<tr id="firstIndex2" class="secondIndex_2_0">',
		        '<td rowspan="1">满意度指标</td>',
		        '<td rowspan="1" class="secondIndex_2_0">服务对象<br/>满意度指标</td>',
		        '<td class="secondIndex_0_2_0 notFilled"></td>',
		        '<td></td>',
		        '<td rowspan="1" class="secondIndex_2_0">服务对象<br/>满意度指标</td>',
		        '<td class="secondIndex_1_2_0 notFilled"></td>',
		        '<td></td>',
		      '</tr>',
		    '</table></td>',
		  '</tr>',
		  '<tr>',
		  '<td colspan="5" class="span_3">',
		  '<button type="button" class="btn btn-sm mr-l" id="uploadFundTable">上传资金分配方案</button><br>',
		  '<button type="button" class="btn  mr-l btn-submint" id="reportSubmit">提&nbsp;&nbsp;交</button>',
		  '</td></tr>'].join('');
		}
		
		function _getCheckStateReport() {
			['<table class ="table-declare"  width="100%" border="1"  cellspacing="0" cellpadding="0" style="border-collapse: collapse";>',
			 '<caption class="table-title">中央对地方专项转移支付中医药区域绩效指标申报表（<input class ="input-top" name="year"></input>        年度)</caption>',
			 	'<tr>',
			 	  '<td colspan="2" >专项名称</td>',
			 	  '<td colspan="3"><input  class="fill-1" name="nameOfSpecialProject"></input></td>',
			 	'</tr>',
			 	'<tr>',
			 	  '<td colspan="2" >中央主管部门</td>',
			 	  '<td width="28%"><input class="fill-2"  name="centralDepartment"></input></td>',
			 	  '<td width="32%" >专项实施期</td>',
			 	  '<td width="18%"><input class="fill-2" name="implPhaseOfSpecialProject"></input></td>',
			 	'</tr>',
			 	'<tr>',
			 	  '<td colspan="2" >省级财政部门</td>',
			 	  '<td><input class="fill-2" name="provincialFinanceDepartment"></input></td>',
			 	  '<td >省级主管部门</td>',
			 	  '<td><input name="implPhaseOfSpecialProject"></input></td>',
			 	'</tr>',
			 	'<tr>',
			 	  '<td width="4%" rowspan="3" >资金情况</td>',
			 	  '<td width="18%" >实施期金额：</td>',
			 	  '<td><input class="fill-2" name="fundsOfImplPhase"></input></td>',
			 	  '<td >年度金额：</td>',
			 	  '<td><input class="fill-2" name="annualFunds"></input></td>',
			 	'</tr>',
			 	'<tr>',
			 	  '<td align="right">其中：中央补助</td>',
			 	  '<td><input class="fill-2" name="centralGrantsOfImplPhase"></input></td>',
			 	  '<td align="right">其中：中央补助</td>',
			 	  '<td><input  class="fill-2" name="centralGrantsOfAnnualFunds"></input></td>',
			 	'</tr>',
			 	'<tr>',
			 	  '<td align="right">地方资金</td>',
			 	  '<td><input class="fill-2" name="localGovernOfImplPhase"></input></td>',
			 	  '<td align="right">地方资金</td>',
			 	  '<td><input class="fill-2" name="localGovernOfAnnualFunds"></input></td>',
			 	'</tr>',
			 	'<tr>',
			     '<td rowspan="2">总体目标</td>',
			     '<td colspan="2">实施期目标</td>',
			     '<td colspan="2">年度目标</td>',
			   '</tr>',
			   '<tr>',
			   	'<td height="26" colspan="2" data-name="targetNameOfImplphase" style="text-align:left;text-indent:2em;">',
			 		'<ul class="target-list"></ul>',	  	
			   	'</td>',
			   	'<td colspan="2" data-name="annualTargetDatalist">',
			   		'<div class="aunnal-target-list">',
			   		'</div>',
			   	'</td>',
			   '</tr>',
			   '<tr>',
			     '<td>绩效指标</td>',
			     '<td height="141" colspan="4" style="padding:0px;">',
			     '<table id="innerTable" width="100%" border="1" align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
			       '<tr>',
			         '<td width="3%">一级指标</td>',
			         '<td width="8%">二级指标</td>',
			         '<td width="23%">三级指标</td>',
			         '<td width="13.99%">指标值</td>',
			         '<td width="9%">二级指标</td>',
			         '<td width="23%">三级指标</td>',
			         '<td width="20%">指标值</td>',
			       '</tr>',
			       '<tr id="firstIndex0" class="secondIndex_0_0">',
			         '<td rowspan="4">',
			          	 '产<br/>出<br/>指<br/>标</td>',
			         '<td rowspan="1" class="secondIndex_0_0">数量指标</td>',
			         '<td class="secondIndex_0_0_0 notFilled"></td>',
			         '<td ></td>',
			         '<td rowspan="1" class="secondIndex_0_0">数量指标</td>',
			         '<td class="secondIndex_1_0_0 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			       '<tr class="secondIndex_0_1">',
			         '<td rowspan="1" class="secondIndex_0_1">质量指标</td>',
			         '<td class="secondIndex_0_0_1 notFilled"></td>',
			         '<td></td>',
			         '<td rowspan="1" class="secondIndex_0_1">质量指标</td>',
			         '<td class="secondIndex_1_0_1 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			       '<tr class="secondIndex_0_2">',
			         '<td rowspan="1" class="secondIndex_0_2">时效指标</td>',
			         '<td class="secondIndex_0_0_2 notFilled"></td>',
			         '<td></td>',
			         '<td rowspan="1" class="secondIndex_0_2">时效指标</td>',
			         '<td class="secondIndex_1_0_2 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			       '<tr class="secondIndex_0_3">',
			         '<td rowspan="1" class="secondIndex_0_3">成本指标</td>',
			         '<td class="secondIndex_0_0_3 notFilled"></td>',
			         '<td ></td>',
			         '<td rowspan="1" class="secondIndex_0_3">成本指标</td>',
			         '<td class="secondIndex_1_0_3 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			       '<tr id="firstIndex1" class="secondIndex_1_0">',
			         '<td rowspan="4">效<br/>益<br/>指<br/>标</td>',
			         '<td rowspan="1" class="secondIndex_1_0">经济效益<br/>指标</td>',
			         '<td class="secondIndex_0_1_0 notFilled"></td>',
			         '<td ></td>',
			         '<td rowspan="1" class="secondIndex_1_0">经济效益<br/>指标</td>',
			         '<td class="secondIndex_1_1_0 notFilled"></td>',
			         '<td>&nbsp;</td>',
			       '</tr>',
			       '<tr class="secondIndex_1_1">',
			         '<td rowspan="1" class="secondIndex_1_1">社会效益<br/>指标</td>',
			         '<td class="secondIndex_0_1_1 notFilled"></td>',
			         '<td ></td>',
			         '<td rowspan="1" class="secondIndex_1_1">社会效益<br/>指标</td>',
			         '<td class="secondIndex_1_1_1 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			       '<tr class="secondIndex_1_2">',
			         '<td rowspan="1" class="secondIndex_1_2">生态效益<br/> 指标</td>',
			         '<td class="secondIndex_0_1_2 notFilled"></td>',
			         '<td></td>',
			         '<td rowspan="1" class="secondIndex_1_2">生态效益<br/>指标</td>',
			         '<td class="secondIndex_1_1_2 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			       '<tr class="secondIndex_1_3">',
			         '<td rowspan="1" class="secondIndex_1_3">可持续影响<br/>指标</td>',
			         '<td class="secondIndex_0_1_3 notFilled"></td>',
			         '<td></td>',
			         '<td rowspan="1" class="secondIndex_1_3">可持续影响<br/>指标</td>',
			         '<td class="secondIndex_1_1_3 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			       '<tr id="firstIndex2" class="secondIndex_2_0">',
			         '<td rowspan="1">满意度指标</td>',
			         '<td class="secondIndex_0_2_0 notFilled"></td>',
			         '<td></td>',
			         '<td rowspan="1" class="secondIndex_2_0">服务对象<br/>满意度指标</td>',
			         '<td class="secondIndex_1_2_0 notFilled"></td>',
			         '<td></td>',
			       '</tr>',
			     '</table></td>',
			   '</tr>',
			 '</table>'].join('');
		}
		
		function _addTableAfterClearTable() {
			return ['<tr>',
					'<th rowspan="3">绩效指标</th>',
					'<td width="100px">产出指标</td>',
					'<td>',
						'<table width="100%" border="1" align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
							'<tr>',
								'<td width="130px">数量指标<i class="fa fa-fw fa-plus-square-o" title="添加数量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_0" data-index="0_0_0">',
										'<div class="ac_box notFilled" data-index="1">',
											//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
							       		   '<input class= "fill-3" name="thirdIndex"></input>',
							       		   '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
								    '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>质量指标<i class="fa fa-fw fa-plus-square-o" title="添加质量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_1" data-index="0_0_1">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-3" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>时效指标<i class="fa fa-fw fa-plus-square-o" title="添加时效指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_2" data-index="0_0_2">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-3" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>成本指标<i class="fa fa-fw fa-plus-square-o" title="添加成本指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_3" data-index="0_0_3">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-3" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr><td colspan="2"></td></tr>',
						'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>效益指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">经济效益指标<i class="fa fa-fw fa-plus-square-o" title="添加经济效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_0" data-index="0_1_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		'<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>社会效益指标<i class="fa fa-fw fa-plus-square-o" title="添加社会效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_1" data-index="0_1_1">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>生态效益指标<i class="fa fa-fw fa-plus-square-o" title="添加生态效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_2" data-index="0_1_2">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>可持续影响指标<i class="fa fa-fw fa-plus-square-o" title="添加可持续影响指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_3" data-index="0_1_3">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>满意度指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">服务对象<i class="fa fa-fw fa-plus-square-o" title="添加服务对象" data-add="add"></i><br>满意度指标</td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_2_0" data-index="0_2_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>',
				'<tr>',
				'<th width="100px">年度总体目标<i class="fa fa-fw fa-plus-square-o aunnal-target" title="添加年度总体目标"></i></th>',
				'<td colspan="2" style="text-align:left" id="annualTargetlist">',
				'<div class="aunnalTargetBox" data-index="1">',
				'<label class="lr-4 ">目标1:</label>',
				'<input class= "fill-1" name="annualTargets"></input>',
				'</div>',
				'</td>',
				'</tr>',
				'<tr>',
				'<th rowspan="3">年度绩效指标</th>',
				'<td width="100px">产出指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
							'<tr>',
								'<td width="130px">数量指标<i class="fa fa-fw fa-plus-square-o" title="添加数量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_0" data-index="1_0_0">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-3" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
								    '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>质量指标<i class="fa fa-fw fa-plus-square-o" title="添加质量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_1" data-index="1_0_1">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-3" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>时效指标<i class="fa fa-fw fa-plus-square-o" title="添加时效指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_2" data-index="1_0_2">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-3" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>成本指标<i class="fa fa-fw fa-plus-square-o" title="添加成本指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_3" data-index="1_0_3">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-3" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr><td colspan="2"></td></tr>',
						'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>效益指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">经济效益指标<i class="fa fa-fw fa-plus-square-o" title="添加经济效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_0" data-index="1_1_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>生态效益指标<i class="fa fa-fw fa-plus-square-o" title="添加生态效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_1" data-index="1_1_1">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>社会效益指标<i class="fa fa-fw fa-plus-square-o" title="添加社会效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_2" data-index="1_1_2">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>可持续影响指标<i class="fa fa-fw fa-plus-square-o" title="添加可持续影响指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_3" data-index="1_1_3">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>满意度指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">服务对象<i class="fa fa-fw fa-plus-square-o" title="添加满意度指标" data-add="add"></i><br>满意度指标</td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_2_0" data-index="1_2_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-3" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		'<input class= "fill-4-1" name="indexValue"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>'].join("");
		}
		
		function _addUpdateTableAfterClearTable() {
			return ['<tr>',
					'<th rowspan="3">绩效指标</th>',
					'<td width="100px">产出指标</td>',
					'<td>',
						'<table width="100%" border="1" align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
							'<tr>',
								'<td width="130px">数量指标<i class="fa fa-fw fa-plus-square-o" title="添加数量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_0" data-index="0_0_0">',
										'<div class="ac_box notFilled" data-index="1">',
											//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
							       		   '<input class= "fill-4-1" name="thirdIndex"></input>',
							       		   '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
							       		   '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
								    '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>质量指标<i class="fa fa-fw fa-plus-square-o" title="添加质量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_1" data-index="0_0_1">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-4-1" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
									       '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>时效指标<i class="fa fa-fw fa-plus-square-o" title="添加时效指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_2" data-index="0_0_2">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-4-1" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
									       '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>成本指标<i class="fa fa-fw fa-plus-square-o" title="添加成本指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 0_0_3" data-index="0_0_3">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-4-1" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
									       '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr><td colspan="2"></td></tr>',
						'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>效益指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">经济效益指标<i class="fa fa-fw fa-plus-square-o" title="添加经济效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_0" data-index="0_1_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>社会效益指标<i class="fa fa-fw fa-plus-square-o" title="添加社会效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_1" data-index="0_1_1">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>生态效益指标<i class="fa fa-fw fa-plus-square-o" title="添加生态效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_2" data-index="0_1_2">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       	    '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>可持续影响指标<i class="fa fa-fw fa-plus-square-o" title="添加可持续影响指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_1_3" data-index="0_1_3">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>满意度指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">服务对象<i class="fa fa-fw fa-plus-square-o" title="添加服务对象" data-add="add"></i><br>满意度指标</td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 0_2_0" data-index="0_2_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>',
				'<tr>',
				'<th width="100px">年度总体目标<i class="fa fa-fw fa-plus-square-o aunnal-target" title="添加年度总体目标"></i></th>',
				'<td colspan="2" style="text-align:left" id="annualUpdateTargetlist">',
				'<div class="aunnalTargetBox" data-index="1">',
				'<label class="lr-4 ">目标1:</label>',
				'<input class= "fill-1" name="annualTargets"></input>',
				'</div>',
				'</td>',
				'</tr>',
				'<tr>',
				'<th rowspan="3">年度绩效指标</th>',
				'<td width="100px">产出指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
							'<tr>',
								'<td width="130px">数量指标<i class="fa fa-fw fa-plus-square-o" title="添加数量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_0" data-index="1_0_0">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-4-1" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
									        '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
								    '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>质量指标<i class="fa fa-fw fa-plus-square-o" title="添加质量指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_1" data-index="1_0_1">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-4-1" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
									       '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>时效指标<i class="fa fa-fw fa-plus-square-o" title="添加时效指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_2" data-index="1_0_2">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-4-1" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
									       '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr>',
								'<td>成本指标<i class="fa fa-fw fa-plus-square-o" title="添加成本指标" data-add="add"></i></td>',
								'<td style="text-align:left">',
									'<div class="targetBox 1_0_3" data-index="1_0_3">',
										'<div class="ac_box notFilled" data-index="1">',
										//'<input name="id" type="hidden"></input>',
							       		   '<label class="lr-4 lr-w">指标1:</label>',
									       '<input class= "fill-4-1" name="thirdIndex"></input>',
									       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
									       '<label class="lr-4 lr-w">参考值</label>',
							       		   '<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
								        '</div>',
							        '</div>',
								'</td>',
							'</tr>',
							'<tr><td colspan="2"></td></tr>',
						'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>效益指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">经济效益指标<i class="fa fa-fw fa-plus-square-o" title="添加经济效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_0" data-index="1_1_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								       '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>生态效益指标<i class="fa fa-fw fa-plus-square-o" title="添加生态效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_1" data-index="1_1_1">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>社会效益指标<i class="fa fa-fw fa-plus-square-o" title="添加社会效益指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_2" data-index="1_1_2">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr>',
				  			'<td>可持续影响指标<i class="fa fa-fw fa-plus-square-o" title="添加可持续影响指标" data-add="add"></i></td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_1_3" data-index="1_1_3">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		   '<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>',
				'<tr>',
					'<td>满意度指标</td>',
					'<td>',
						'<table border="1" width="100%"  align="left" cellpadding="0" cellspacing="0" style="border-collapse: collapse;border-width:0px; border-style:hidden;">',
				  		'<tr>',
				  			'<td width="130px">服务对象<i class="fa fa-fw fa-plus-square-o" title="添加满意度指标" data-add="add"></i><br>满意度指标</td>',
				  			'<td style="text-align:left">',
				  				'<div class="targetBox 1_2_0" data-index="1_2_0">',
									'<div class="ac_box notFilled" data-index="1">',
									//'<input name="id" type="hidden"></input>',
						       		   '<label class="lr-4 lr-w">指标1:</label>',
								       '<input class= "fill-4-1" name="thirdIndex"></input>',
								       '<label class="lr-4 lr-w">指标值:</label>',
							       		'<input class= "fill-4-1" name="indexValue"></input>',
								        '<label class="lr-4 lr-w">参考值</label>',
							       		'<input class= "fill-4-1" name="referValue" readOnly="true"></input>',
							        '</div>',
						        '</div>',
				  			'</td>',
				  		'</tr>',
				  		'<tr><td colspan="2"></td></tr>',
				  	'</table>',
					'</td>',
				'</tr>'].join("");
		}
		
		//针对一条申报表的所有数据
		function getAllOFReportInfo(reportData) {
			var targetNameOfImplphase = reportData.targetNameOfImplphase; //实施期目标名称
			var targetAttribute =reportData.targetAttribute;		//"目标属性"
			var annualTargetDatalist = reportData.annualTargetDatalist;	//年度目标数组
			var indexdata = reportData.indexEntityList;	//指标，包括：实施期、年度
			//追加实施其目标
			var targetNameOfImplphaseObj = $($('td .target-list')[0]);
			var implTargetindex = targetNameOfImplphaseObj.children().length + 1;
			var li = getTargetNameOfImplphaseLi(implTargetindex, targetNameOfImplphase, targetAttribute)
			targetNameOfImplphaseObj.append(li);
			
			//追加年度目标
			var aunnalTargetObj = $($('td .aunnal-target-list')[0]);
			var aunnalTargetIndex = aunnalTargetObj.children().length + 1;
			var aunnalTargetDiv = getAunnalTargetDivs(aunnalTargetIndex, annualTargetDatalist);
			aunnalTargetObj.append(aunnalTargetDiv);

			_handleIndexData(indexData);
		}
		
		//其他司使用的更新指标参考值的时候用
		function getIndexes(id, targetOfImplPhase) {
			var targetBoxes = $('#' + id + ' .targetBox'), i = 0, targetLen = targetBoxes.length,
				indexId = "", j=0, indexLen = 0, targetBox = {}, $tb = {}, targetIndex = "", index="", targetType ="",
				firstIndex = "", secondIndex="", thirdIndex="", indexValue="", indexes = [], referValue="";
			for(i=0; i<targetLen; i++) {
				//外部的box
				targetBox = targetBoxes[i];
				targetIndex = $(targetBox).attr('data-index');
				targetType = targetIndex.substring(0,1);
				firstIndex = targetIndex.substring(2,3);
				secondIndex = targetIndex.substring(4);
				indexId = $($(targetBox).find('input[name="id"]')[0]).val();
				//原子：指标
				indexBoxes = $(targetBox).children();
				indexLen = indexBoxes.length;
				
				for(j=0; j<indexLen; j++) {
					$tb = $(indexBoxes[j]);
					index = $tb.attr('data-index');
					thirdIndex = $.trim($tb.find('input[name=thirdIndex]').val());
					referValue = $tb.find('input[name=referValue]')? $.trim($tb.find('input[name=referValue]').val()): "";
					indexValue = $tb.find('input[name=indexValue]')? $.trim($tb.find('input[name=indexValue]').val()): "";
					if(!orange.strIsBlank(thirdIndex) && !orange.strIsBlank(referValue)) {	//指标名
						indexes.push({
							'id': indexId,	//指标id
							'firstIndex': firstIndex,	//一级指标
							'secondIndex': secondIndex,	//二级指标
							'thirdIndex': thirdIndex,	//三级指标
							'indexValue': indexValue,
							'referValue': referValue,	//指标值
							'targetsOfImplPhase': "",	//所属实施期目标ID
							'targetType': targetType,	//目标类型（实施期目标：0，年度目标：1）
							'code': index //指标编码
						});
					}
				}
			}
			targetOfImplPhase['indexDatas'] = indexes;
		}
		
		return  {
			getInitTableContent: _getInitTableContent,	//填报时，需要在table中插入一部分tr
			handleIndexData : _handleIndexData,	//将指标动态填入表格
			deleteTrNextTrList: _deleteTrNextTrList,	//删除某一个id后的所有元素
			getCheckStateReport:_getCheckStateReport,	//当在列表中，查看某一条记录时，添加默认的table
			getIndexes: getIndexes,
			getOnlyTable:_getOnlyTable,	//获取单独table部分
			addTableAfterClearTable: _addTableAfterClearTable,
			addUpdateTableAfterClearTable: _addUpdateTableAfterClearTable
		};
	});
})();
